let App = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrls: [{
      img: "../../images/EmptyBanner.jpg",
      openpath: "../../pages/figure/figure"
    }, {
      img: "../../images/EmptyBanner1.jpg",
      openpath: "../../pages/bankQuery/bankQuery"
    }, {
      img: "../../images/EmptyBanner2.jpg",
      openpath: "../../pages/IDCard/IDCard"
    }, {
      img: "../../images/EmptyBanner3.jpg",
      openpath: "../../pages/MobileHome/MobileHome"
    }],
    server: [{
        img: "../../images/clac.png",
        openpath: "../../pages/study/set",
        text: "数学",
        need: true
      },
      {
        img: "../../images/clark.png",
        openpath: "../../pages/clark/index",
        text: "认识钟表"
      },
      {
        img: "../../images/cha.png",
        openpath: "../../pages/similar/index",
        text: "近、反义词"
      },
      
      {
        img: "../../images/cha.png",
        openpath: "../../pages/todayHistory/index",
        text: "历史今天"
      },
      {
        img: "../../images/hl.png",
        openpath: "../../pages/cand/index",
        text: "程序员黄历"
      },
      {
        img: "../../images/gz.png",
        openpath: "../../pages/game/game",
        text: "摇骰子"
      },
      {
        img: "../../images/cha.png",
        openpath: "../../pages/MobileHome/MobileHome",
        text: "手机归属地"
      },
      {
        img: "../../images/kd.png",
        openpath: "../../pages/postage/index",
        text: "全国快递"
      },
    ],
    unserver: [
      {
        img: "../../images/bq4.png",
        openpath: "../../pages/food/list",
        text: "美食制作",
        need: true
      },
      {
        img: "../../images/ip.png",
        openpath: "../../pages/driver/index",
        text: "驾考宝典",
        need: true
      }
     
    ],
    indicatorDots: true,
    autoplay: true,
    interval: 5000,
    duration: 1000
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  noComplete: function () {
    wx.showModal({
      title: '提示',
      content: '暂未开放',
      showCancel: false
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  checkAuth: function (e) {
    var that = this
    var need = e.currentTarget.dataset.need
    var path = e.currentTarget.dataset.path
    var text = e.currentTarget.dataset.text
    if (need && !App.checkIsLogin()) {
      App.showError('很抱歉，您还没有登录', function () {
        wx.navigateTo({
          url: '/pages/login/login',
        })
      });
      return false;
    } else {

    }

      wx.navigateTo({
        url: path,
      })
    
   

  }
})